<template>
  <div class="login-container">
    <slot></slot>

    <div v-if="getIsArchivalInformationShow()" class="fixed bottom-0px w-100% h-32px" style="text-align: center; color: #666666">
      <!-- Copyright © 2024 版权所有 山东趣深网络科技有限公司 鲁ICP备17003119号-15 -->
    </div>

    <vab-icon class="login-background" icon="background" is-custom-svg />
    <vab-footer />
  </div>
</template>

<script lang="ts" setup>
defineOptions({ name: 'LoginContainer' })

const getIsArchivalInformationShow = () => {
  //@ts-ignore
  return window?.configuration?.isArchivalInformationShow ? false : true
}
</script>

<style lang="scss" scoped>
.login-container {
  position: relative;
  // display: flex;
  // justify-content: flex-end;
  height: calc(var(--vh, 1vh) * 100);
  background: url('/@/assets/login_images/background.png') no-repeat center;
  background-size: cover;

  .login-right-tools {
    position: fixed;
    top: var(--el-margin);
    right: var(--el-margin);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: calc(var(--el-padding) / 2);
    background: var(--el-color-white);
    border: 1px solid var(--el-border-color);
    border-radius: var(--el-border-radius-base);

    :deep() {
      .vab-language,
      .vab-color-picker,
      .vab-dark {
        margin: 0 calc(var(--el-padding) / 2) 0 calc(var(--el-padding) / 2) !important;
      }
    }
  }

  @media (max-width: 696px) {
    .login-right-tools,
    .login-background {
      display: none;
    }

    :deep() {
      .login-form {
        width: 90vw !important;
        margin: auto !important;

        .left-img {
          display: none !important;
        }

        .el-form--default {
          width: 100% !important;
          margin-right: auto !important;
          margin-left: auto !important;
        }
      }
    }
  }

  @media (min-width: 696px) and (max-width: 999px) {
    .login-right-tools,
    .login-background {
      display: none;
    }

    :deep() {
      .login-form {
        width: 90vw !important;
        margin: auto !important;

        .el-form--default {
          width: 50% !important;
        }
      }
    }
  }

  :deep() {
    .login-form {
      position: absolute;
      left: 8vw;
      top: 50%;
      transform: translate(0, -50%);
      z-index: 1;
      // display: flex;
      // align-items: center;
      // justify-content: space-between;
      padding: 6vw 80px 6vw;
      width: calc(330px + 10vw);
      // height: 100%;
      background-color: #89a7ef15;
      backdrop-filter: blur(5px);
      border: 2px solid #f2f4f6;
      border-radius: 15px;
      box-shadow:
        1px 1px 1px #f2f6fc,
        -1px -1px 1px #ebeef5;

      overflow: hidden;

      transition: var(--el-transition);

      * {
        transition: var(--el-transition);
      }

      .el-form--default {
        width: 100%;
      }

      .title {
        font-size: 54px;
        font-weight: 500;
        color: var(--el-color-grey);
      }

      .title-tips {
        margin-top: 29px;
        font-size: 24px;
        font-weight: 400;
        color: var(--el-color-grey);
      }

      .login-btn {
        margin-top: 52px;
        width: 100%;
        height: 44px;
        border: 1px solid #f2f4f6;
        font-size: 17px;
      }

      .el-form-item {
        margin: 20px 0;

        &__error {
          position: absolute;
          font-size: var(--el-font-size-small);
          line-height: 18px;
          color: var(--el-color-error);
        }

        .el-input {
          width: 100%;
          height: 48px;
          line-height: 48px;
        }
      }

      .code {
        position: absolute;
        top: 4px;
        right: 4px;
        cursor: pointer;
        border-radius: var(--el-border-radius-base);
      }

      .phone-code {
        position: absolute;
        top: 8px;
        right: 10px;
        width: 120px;
        height: 32px;
        font-size: var(--el-font-size-default);
        color: var(--el-color-white);
        cursor: pointer;
        user-select: none;
        border-radius: 3px;
      }
    }

    .vab-footer {
      position: fixed;
      right: 0;
      bottom: 0;
      left: 0;
      background: transparent;
      border: 0;
    }
  }

  .login-background {
    position: fixed;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 0;
    width: 100vw;
    height: 35vh;
    pointer-events: none;
  }
}
</style>
